import { Text, View } from "@tarojs/components";
import React from "react";
import { AtIcon } from "taro-ui";
import { Menu } from "../../pages/index/models";
import "./index.scss";

interface BaseMenuProps{
  menus:Menu[]
}

export const BaseMenu = ({
  menus
}:BaseMenuProps) => {
  return (
    <>
      <View className='menus'>
        {
          menus.map((menu)=>(
            <View className='menu-item' key={menu.id}>
              <View className='menu-item--icon'>
                <AtIcon prefixClass='icon' value={menu.iconName} size='42' />
              </View>
              <Text className='menu-item--title'>{menu.title}</Text>
            </View>
          ))
        }
      </View>
    </>
  )
}
